//
// Created by enemy1205 on 2021/8/10.
//
#include <iostream>
#include "globalFile.h"
#include "system_control/Include/control.h"

using namespace std;

int main() {
    int choice;
    Control ctl;
    while (true) {
        cout << "======================  欢迎来到机房预约系统  =====================" << endl;
        cout << endl << "请输入您的身份" << endl;
        cout << "\t\t -------------------------------\n";
        cout << "\t\t|                               |\n";
        cout << "\t\t|          1.学生代表           |\n";
        cout << "\t\t|                               |\n";
        cout << "\t\t|          2.老    师           |\n";
        cout << "\t\t|                               |\n";
        cout << "\t\t|          3.管 理 员           |\n";
        cout << "\t\t|                               |\n";
        cout << "\t\t|          0.退    出           |\n";
        cout << "\t\t|                               |\n";
        cout << "\t\t -------------------------------\n";
        cout << "输入您的选择: ";
        cin >> choice;
        switch (choice) {
            {
                case 1: //学生身份{
                    ctl.Login(STUDENT_FILE, 1);
                    getchar();
                break;
            }
            case 2://老师身份
            {
                ctl.Login(TEACHER_FILE, 2);
                getchar();
                break;
            }
            case 3://管理员身份
            {
                ctl.Login(ADMIN_FILE, 3);
                getchar();
                break;
            }
            case 0://退出系统
                cout << "欢迎下一次使用" << endl;
                getchar();
                return 0;
            default:
                cout << "输入有误，请重新选择！" << endl;
                getchar();
                printf("\33[2J");
                break;
        }
    }
}